package com.smart.reader.model.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
@Getter
@Setter
public class BaseEntity implements Serializable {
    private static final long serialVersionUID = -569425995057788007L;
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    @TableField("version")
    @Version
    private Integer version =  1;
    /**
     * 创建者
     */
    @TableField(value = "create_user",fill = FieldFill.INSERT)
    private Long createUser;
    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新者
     */
    @TableField(value = "update_user",fill = FieldFill.INSERT)
    private Long updateUser;
    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;
}
